import  req from '@/http/reqdata'
let {reqGetCategoryListData,reqgetBannerList,reqgetFloorsList} = req

export default {
    namespaced:true, 
    state:{
      // 三级导航数据
        typenavdata:[],
      // 大轮播图数据
        bannerList:[],
      //   楼层数据
      floorsList:[]
    },
    mutations:{
       settypenavdata(state,value){
        state.typenavdata = value.data.slice(0,15)
      //   console.log(state.typenavdata);
       },
       setBannerList(state,value){
         // console.log(value);
         state.bannerList = value.data
        //  console.log(state.bannerList);
       },
       setFloorsList(state,value){
         // console.log(value);
         state.floorsList = value.data
        //  console.log(state.floorsList);
       }
    },
    actions:{
       async reqtypenavdata(context){
          let refaut = await reqGetCategoryListData() ;
         //  console.log(refaut);
         // let newdata = refaut
          context.commit('settypenavdata',refaut)
       },
       async reqBannerList(context){
         let newdata = await reqgetBannerList()
         context.commit('setBannerList',newdata)
       },
       async reqFloorsList(context){
         let newdata = await reqgetFloorsList()
         context.commit('setFloorsList',newdata)
       }
    },
    getters:{

    }
}